{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}
{{#unless view.isLoaded}}
  <div class="spinner spinner-centered"></div>
{{/unless}}
<div {{bindAttr class=":row-fluid view.isLoaded::content-loading"}}>
  <form class="form-horizontal">
    <div class="add-data-set">
      <table>
        <tr {{bindAttr class="errors.isNameError:error"}}>
          <td class="percent25" colspan="1">
            {{t mirroring.dataset.name}}
          </td>
          <td colspan="2" style="text-align: left">
            {{view Ember.TextField valueBinding="formFields.datasetName" class="span4" disabledBinding="controller.isEdit"}}
            <span class="help-inline">{{errorMessages.name}}</span>
          </td>
        </tr>
        <tr>
          <td class="spacer" colspan="3"></td>
        </tr>

        <tr>
          <td class="percent25" colspan="1">
            {{t mirroring.dataset.type}}
          </td>
          <td colspan="2" style="text-align: left">
            {{t mirroring.dataset.type.HDFS}}
          </td>
        </tr>
        <tr>
          <td class="spacer" colspan="3"></td>
        </tr>

        <tr>
          <td class="percent25" colspan="1">
            {{t mirroring.dataset.sourceCluster}}
          </td>
          <td colspan="2" style="text-align: left">
            {{App.clusterName}}
          </td>
        </tr>
        <tr>
          <td class="spacer" colspan="3"></td>
        </tr>

        <tr {{bindAttr class="errors.isSourceDirError:error"}}>
          <td colspan="1">
            {{t mirroring.dataset.sourceDir}}
          </td>
          <td colspan="2" style="text-align: left">
            {{view Ember.TextField valueBinding="formFields.datasetSourceDir" class="span4"}}
            <span class="help-inline">{{errorMessages.sourceDir}}</span>
          </td>
        </tr>
        <tr>
          <td class="spacer" colspan="3"></td>
        </tr>
        <tr {{bindAttr class="errors.isTargetClusterNameError:error"}}>
          <td colspan="1">
            {{t mirroring.dataset.targetCluster}}
          </td>
          <td colspan="2" style="text-align: left">
            {{#if view.hasTargetClusters}}
              {{view view.targetClusterSelect selectionBinding="formFields.datasetTargetClusterName"}}
            {{else}}
              <button class="btn" {{action manageClusters target="view"}}>{{t mirroring.dataset.addTargetCluster}}</button>
            {{/if}}
            <span class="help-inline">{{errorMessages.targetClusterName}}</span>
          </td>
        </tr>
        <tr>
          <td class="spacer" colspan="3"></td>
        </tr>
        <tr {{bindAttr class="errors.isTargetDirError:error"}}>
          <td class="spacer" colspan="1">
            {{t mirroring.dataset.targetDir}}
          </td>
          <td colspan="2" style="text-align: left">
            {{view Ember.TextField valueBinding="formFields.datasetTargetDir" class="span4"}}
            <span class="help-inline">{{errorMessages.targetDir}}</span>
          </td>
        </tr>
        <tr>
          <td class="spacer" colspan="3"></td>
        </tr>
        <tr>
          <td colspan="1"> {{t mirroring.dataset.schedule}} </td>
          <td colspan="2" style="text-align: left">
            <div {{bindAttr class="errors.isStartDateError:error"}}>
              {{view Ember.TextField valueBinding="formFields.datasetStartDate" class="input-small datepicker" disabledBinding="controller.isEdit"}}
              {{view view.select contentBinding="view.hourOptions" selectionBinding="formFields.hoursForStart" class="input-mini" disabledBinding="controller.isEdit"}}
              {{view view.select contentBinding="view.minuteOptions" selectionBinding="formFields.minutesForStart" class="input-mini" disabledBinding="controller.isEdit"}}
              {{view view.select contentBinding="view.middayPeriodOptions" selectionBinding="formFields.middayPeriodForStart" class="input-mini" disabledBinding="controller.isEdit"}}
              <span class="help-inline">{{errorMessages.startDate}}</span>
            </div>
            <div>
              {{t mirroring.dataset.schedule.to}}
            </div>
            <div {{bindAttr class="errors.isEndDateError:error"}}>
              {{view Ember.TextField valueBinding="formFields.datasetEndDate" class="input-small datepicker"}}
              {{view Ember.Select contentBinding="view.hourOptions" selectionBinding="formFields.hoursForEnd" class="input-mini"}}
              {{view Ember.Select contentBinding="view.minuteOptions" selectionBinding="formFields.minutesForEnd" class="input-mini"}}
              {{view Ember.Select contentBinding="view.middayPeriodOptions" selectionBinding="formFields.middayPeriodForEnd" class="input-mini"}}
              <span class="help-inline">{{errorMessages.endDate}}</span>
            </div>

            <div {{bindAttr class=" :each-row errors.isFrequencyError:error"}}>
              {{t mirroring.dataset.schedule.repeatEvery}}
              {{view Ember.TextField valueBinding="formFields.datasetFrequency" class="input-mini"}}
              {{view Ember.Select contentBinding="view.repeatOptions" selectionBinding="formFields.repeatOptionSelected" class="input-small"}}
              <span class="help-inline">{{errorMessages.frequency}}</span>
            </div>
          </td>
        </tr>
      </table>
    </div>
  </form>
</div>
